#ifndef FGE_GAMESCREEN_HPP
#define FGE_GAMESCREEN_HPP

namespace fge
{

class ScreenManager;

enum ScreenState
{
	ScreenState_Waiting,
	ScreenState_TransitionOn,
	ScreenState_Active,
	ScreenState_TransitionOff,
	ScreenState_Hidden
};

class GameScreen
{
public:
	GameScreen();
	virtual ~GameScreen();

	bool IsPopup() const { return isPopup; }
	bool HasFocus() const { return hasFocus; }
	bool GetAllowHiding() const { return allowHiding; }

	float GetTransitionOnTime() const { return transitionOnTime; }
	float GetTransitionOffTime() const { return transitionOffTime; }
	float GetTransitionPosition() const { return transitionPosition; }

	ScreenState GetScreenState() const { return screenState; }
	void SetScreenState(ScreenState state) { screenState = state; }
	ScreenManager* GetScreenManager() const { return screenManager; }
	void SetScreenManager(ScreenManager *sm) { screenManager = sm; }

	void Update(float deltaSeconds, bool hasFocus, bool isCovered);

	void ExitScreen(bool allowTransition);

	bool NeedsRemoved() const { return remove; }
	bool IsManaged() const { return managed; }

	virtual void LoadContent() { }
	virtual void UnloadContent() { }

	virtual void Update(float deltaSeconds) { }
	virtual void Draw() { }

protected:
	bool hasFocus;
	bool isPopup;
	bool allowHiding;

	bool remove;
	bool managed;

	float transitionOnTime;
	float transitionOffTime;
	float transitionPosition;

	ScreenState screenState;
	ScreenManager *screenManager;
};

}

#endif//FGE_GAMESCREEN_HPP